#define _CRT_SECURE_NO_WARNINGS 1
int* singleNumber(int* nums, int numsSize, int* returnSize) {
    int ret = 0;
    for (int i = 0; i < numsSize; i++)
    {
        ret ^= nums[i];
    }
    int pos = 0;
    for (int i = 0; i < 32; i++)
    {
        if ((ret >> i) & 1 == 1)
        {
            pos = i;
            break;
        }
    }
    int single_1 = 0;
    int single_2 = 0;
    for (int i = 0; i < numsSize; i++)
    {
        if ((nums[i] >> pos) & 1 == 1)
        {
            single_1 ^= nums[i];
        }
    }

    single_2 = single_1 ^ ret;
    *returnSize = 2;
    int* ans = malloc(sizeof(int) * 2);
    ans[0] = single_1;
    ans[1] = single_2;
    return ans;
}